<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/testTpl1.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <!-- InstanceBeginEditable name="doctitle" -->
    <title>TestPage</title>
    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    <!-- InstanceEndEditable -->
    <link rel="stylesheet" type="text/css" href="../style/google/KitchenSink.css">
    <!-- InstanceBeginEditable name="additionalStyle" -->
    <!-- InstanceEndEditable -->

    <script type="text/javascript">
    var djConfig = {
        isDebug: true
        ,debugAtAllCosts: true
    };
    </script>

    <script type="text/javascript" src="../../../trimpath/template-1.0.38.js"></script>
    <script type="text/javascript" src="../../../dojo/deploy/dojo.js"></script>
    <script type="text/javascript" src="../../../dojo-lotex/dojo-lotex.js"></script>
    <script type="text/javascript" src="../../velcro.js"></script>

    <!-- InstanceBeginEditable name="dojoRequire" -->

    <script type="text/javascript">
    dojo.require("lotex.util.Tree");
    dojo.require("lotex.io");
    dojo.require("lotex.string");
    dojo.require("velcro.item");
    dojo.require("velcro.orgunit");

    dojo.hostenv.writeIncludes();
    </script>

    <!-- InstanceEndEditable -->
    <!-- InstanceBeginEditable name="headScript" -->

    <script type="text/javascript">
    var tree;

    var kw = {
        url: velcroConfig["humresFile"],
        sync: true,
        mimetype: "text/plain",
        load: function(type, data, evt) {
            var str = lotex.string.cleanComments(data);
            tree = lotex.util.TreeFilePaser(str);

            tree.forEach(function(node){
                var man = dojo.string.trim(node.getValue());
                if(lotex.string.isBlank(man)) return;
d('########################################################################');
d("建立人事卡片 : ",man);

                var manAttr = [];
                node.forEach(function(node){
                    var attr = dojo.string.trim(node.getValue());
                    manAttr.push(attr);
                });
d("  卡片属性 : ",manAttr);
                if(manAttr.length < 6) {
d("建立人事卡片失败：属性不全，请依照所给格式补全人事文件。");
                    return;
                }
d("建立人事卡片成功，返回 Id : ");
                //var selItemType = new velcro.item.SelectItemType(item);
                //var selItemTypeId = selItemType.save();
                //d("创建成功，返回Id: ", selItemTypeId);
            });
        },
        error: function(t, e) {
            alert("找不到文件 : " + velcroConfig["humresFile"]);
            dd(t, e);
        }
    };
    dojo.io.bind(kw);

    </script>

    <!-- InstanceEndEditable -->
</head>
<body>
    <table style="width: 100%" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td style="vertical-align: top" align="left">
                    <div class="ks-Info">
                        Testpage</div>
                </td>
            </tr>
            <tr>
                <td style="vertical-align: top" align="left">
                    <table class="ks-Sink" cellspacing="0" cellpadding="0">
                        <tbody>
                            <tr>
                                <td style="vertical-align: top; width: 100%; height: 100%" align="left">
                                    <div id="container">
                                        <!-- InstanceBeginEditable name="htmlContainer" -->
                                        <!-- InstanceEndEditable -->
                                    </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </tbody>
    </table>
    <fieldset>
        <legend>Output</legend>
        <div id="debug.output">
        </div>
    </fieldset>
</body>
<!-- InstanceEnd --></html>
